1. Field of the Invention
This invention relates generally to circuits such as host adapters that determine whether devices respond before the ends of multiple types of time-out periods, and particularly to timers for such circuits.
2. Description of Related Art
Personal computers use host adapters such as SCSI controllers to control communications with peripheral devices. A host adapter is conventionally on a circuit board that attaches to a system bus such as a PCI bus in a host computer, and peripheral devices connect to the host adapter via a peripheral bus such as a fiber channel bus or a SCSI bus. To control a target device on the peripheral bus, the host adapter sends commands (or requests) to the target peripheral device and then waits for the target peripheral devices to respond. The host adapter, while waiting for a response from one peripheral device, can send other commands to other peripheral devices or to the same peripheral device. Accordingly, the host adapter may be waiting for responses from several different pending commands.
Each command can have one or more different types of time-out period during which host adapter expects a particular type of response. If the peripheral does not respond before the end of a time-out period, an error has occurred which the host adapter must handle error according to the type of time out. Typically, the host adapter either retransmits a command or notifies the host computer that a peripheral device is not responding in the event that the peripheral fails to respond before the time-out. Conventionally, host adapters may have several timers for the multiple pending commands that may have different time-out periods. Such timers typically include a counter that is loaded with an appropriate time-out count when the host adapter sends a command to a peripheral. The counter decrements the time-out count while the host adapter waits for a response. A time-out occurs if the counter decrements the count to zero before the peripheral responds. When an instruction times out, the timer typically sets a control bit corresponding to the type of time out, and the host adapter takes appropriate action for the type of time out.
A problem with conventional timers is that each pending command and each type of time out may require a separate timer. With protocols for peripheral buses now permitting greater numbers of pending transfers and with host adapters controlling a broader spectrum of devices, a large number of commands can be pending and several time out periods must be simultaneously monitored. Providing timers for each time out for each pending command requires circuit area in the host adapter and increases the host adapter's complexity and cost. Accordingly, methods and circuits are sought that can time a large number of pending commands with different time out periods without using a proportionally large amount of circuit area.